package cn.demo.text.editor.strategy.menu;

import cn.demo.text.editor.constant.Str;

import javax.swing.*;
import java.awt.event.ActionListener;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;

public class PasswordMenuItem extends JMenuItem {

    public PasswordMenuItem(ActionListener actionListener) {
        super(Str.PASSWORD, null);
        this.addActionListener(actionListener);
        this.setActionCommand(Str.PASSWORD);
        this.setFont(new MenuFont());
        this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_P, InputEvent.CTRL_MASK));
    }
}